package com.share.service.sysmgr.privilege;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.share.bean.sysmgr.privilege.PrivilegeRole;
import com.share.dao.sysmgr.privilege.PrivilegeRoleDao;


@Component("privilegeRoleManager")
public class PrivilegeRoleManagerImpl implements PrivilegeRoleManager{

	private PrivilegeRoleDao roleDao ;
	
	@Resource
	public void setRoleDao(PrivilegeRoleDao roleDao) {
		this.roleDao = roleDao;
	}

	@Override
	public void deleteRoleManager(int id) throws Exception {
		this.roleDao.deleteRoleDao(id) ;
		
	}

	@Override
	public PrivilegeRole queryByIdRoleManager(int id) throws Exception {
		
		return this.roleDao.queryByIdRoleDao(id) ;
	}

	@Override
	public List<PrivilegeRole> queryRoleManager() throws Exception {
		
		String hql = "select o from PrivilegeRole o" ;
		
		return this.roleDao.queryRoleDao(hql) ;
	}

	@Override
	public void saveRoleManager(PrivilegeRole role) throws Exception {
		System.out.println(role);
		this.roleDao.saveRoleDao(role) ;
	}

	@Override
	public void updateRoleManager(PrivilegeRole role) throws Exception {
		this.roleDao.updateRoleDao(role) ;
		
	}

}
